<?php 
 
     $conn = oci_connect("hospital", "hospital", "//localhost/XE"); 
	$sql =  "select * from pay where STAFF_ID = $_POST[sta_id]";
	echo $sql;
	$pull = oci_parse($conn,$sql);
	oci_execute($pull);
	
	$total = 0;
	$total = oci_fetch_all($pull,$result);
	
	if( $total != 0){
		echo "This  ID  already have";
	}else{
		
		$sql2 = "INSERT INTO PAY VALUES('$_POST[sta_id]','$_POST[fin_id]')";
		echo $sql2;
		$add = oci_parse($conn,$sql2 );
		oci_execute($add);
	}


 ?>
 <html>
<head><meta http-equiv="refresh" content="1; URL=pay.php"></head>
<BODY bgcolor = "#ffffff">
 <font color="#ffffff" size="20">Redirecting ...</font>
 </body>
 </html>
